home *** CD-ROM | disk | FTP | other *** search
- PACK(3I) Last changed: 1-6-98
-
-
- NNAAMMEE
- PPAACCKK - Packs an array into an array of rank one under control of a
- mask
-
- SSYYNNOOPPSSIISS
- PPAACCKK (([AARRRRAAYY==]_a_r_r_a_y,, [MMAASSKK==]_m_a_s_k [,,[VVEECCTTOORR==]_v_e_c_t_o_r]))
-
- IIMMPPLLEEMMEENNTTAATTIIOONN
- UNICOS, UNICOS/mk, and IRIX systems
-
- SSTTAANNDDAARRDDSS
- Fortran 90
-
- DDEESSCCRRIIPPTTIIOONN
- The PPAACCKK intrinsic function packs an array into an array of rank one
- under control of a mask. It can be used for array construction. It
- accepts the following arguments:
-
- _a_r_r_a_y Can be of any type. It must not be scalar.
-
- _m_a_s_k Must be of type logical and must be conformable with _a_r_r_a_y.
-
- _v_e_c_t_o_r Must be of the same type as _a_r_r_a_y and must have rank one.
- _v_e_c_t_o_r must have at least as many elements as there are true
- elements in _m_a_s_k. If _m_a_s_k is scalar with the value true,
- _v_e_c_t_o_r must have at least as many elements as there are in
- _a_r_r_a_y.
-
- PPAACCKK is a transformational function. The name of this intrinsic
- cannot be passed as an argument.
-
- RREETTUURRNN VVAALLUUEESS
- The result is an array of rank one of the same type as _a_r_r_a_y. If
- _v_e_c_t_o_r is present, the result size is that of _v_e_c_t_o_r; otherwise, the
- result size is the number _t of true elements in _m_a_s_k unless _m_a_s_k is
- scalar with the value true in which case the result size is the size
- of _a_r_r_a_y.
-
- Element _i of the result is the element of _a_r_r_a_y that corresponds to
- the _ith true element of _m_a_s_k, taking elements in array element order,
- for _i=1, 2, ..., _t. If _v_e_c_t_o_r is present and has size _n>_t, element _i
- of the result has the value _v_e_c_t_o_r(_i), for _i=_t+1, ..., _n.
-
- EEXXAAMMPPLLEESS
- Example 1: If NN == ((// 11,, --11,, 33 //)), the following are true:
-
- PPAACCKK(( NN,, MMAASSKK==NN..LLTT..00)) is [-1].
-
- PPAACCKK(( NN,, MMAASSKK==..TTRRUUEE..)) is [1, -1, 3].
-
- Example 2: Array MM is as follows:
-
- | 0 0 0 |
-
- | 9 0 0 |
-
- | 0 0 7 |
-
- The nonzero elements of array MM can be gathered by the PPAACCKK function.
- The following are the results:
-
- PPAACCKK((MM,, MMAASSKK==MM..NNEE..00)) is [9, 7].
-
- PPAACCKK((MM,, MMAASSKK==MM..NNEE..00,, VVEECCTTOORR==((//22,, 44,, 66,, 88,, 1100,, 1122//)))) is [9, 7, 6,
- 8, 10 12].
-
- SSEEEE AALLSSOO
- _I_n_t_r_i_n_s_i_c _P_r_o_c_e_d_u_r_e_s _R_e_f_e_r_e_n_c_e _M_a_n_u_a_l, publication SR-2138, for the
- printed version of this man page.
-
-